function doIframe(){//alert("doIframe");
	o = document.getElementsByTagName('iframe');
	for(i=0;i<o.length;i++){
		if (/\bautoHeight\b/.test(o[i].className)){
			setHeight(o[i]);
			addEvent(o[i],'load', doIframe);
		}
	}
}

function setHeight(e){//alert("setHeight"+e.contentDocument);
	if(e.contentDocument){
		e.height = e.contentDocument.body.offsetHeight+35;//alert("1 : "+e.contentDocument.body.offsetHeight);
	} else {
		height = parseInt(e.contentWindow.document.body.scrollHeight);
		if(height < 200)
			e.height = e.contentWindow.document.body.scrollHeight;
		else 
		 	e.height = 200;
	}
}

function addEvent(obj, evType, fn){//alert("addEvent");
	if(obj.addEventListener)
	{
	obj.addEventListener(evType, fn,false);
	return true;
	} else if (obj.attachEvent){
	var r = obj.attachEvent("on"+evType, fn);
	return r;
	} else {
	return false;
	}
}

if (document.getElementById && document.createTextNode){//alert("load");
 addEvent(window,'load', doIframe);	
}
